package com.example.hzq.food.service;

import com.example.hzq.food.bean.Success;
import com.example.hzq.food.bean.CollectBean;
import com.example.hzq.food.bean.FoodBean;
import com.example.hzq.food.bean.LoginBean;
import com.example.hzq.food.bean.MyBean;
import com.example.hzq.food.bean.OrderBean;
import com.example.hzq.food.bean.RegisterBean;
import com.example.hzq.food.bean.ShopBean;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by hzq on 2017/6/13.
 */

public interface Service {
    @GET( "getFoodByShop.do")//菜品列表
    Call<List<FoodBean>> getfood(@Query("shop_id") int shop_id);
    @GET( "userLogin.do")//登录
    Call<LoginBean> login(@Query("username") String userName,@Query("userpass") String userPwd);
    @GET( "userRegister.do")//注册
    Call<RegisterBean> register(@Query("username") String userName,@Query("userpass") String userPwd,@Query("mobilenum") String phone,@Query("address") String address,@Query("comment") String comment);
    @GET( "getAllShops.do")//店铺列表
    Call<List<ShopBean>> getshop();
    @GET( "getUserById.do")//查看用户详情
    Call<MyBean>getmy(@Query("user_id") int use_id);
    @GET( "getAllUserCollection.do")//获得收藏列表
    Call<List<CollectBean>> getmycollect(@Query("user_id") int user_id,@Query("flag") int flag);
    @GET( "userCollectShop.do")//收藏/取消收藏店铺
    Call<CollectBean>collectornoshop(@Query("user_id") int user_id,@Query("shop_id") int shop_id);
    @GET( "userCollectFood.do")//收藏/取消收藏菜品
    Call<CollectBean>collectornofood(@Query("user_id") int user_id,@Query("food_id") int foodid);
    @GET( "isCollected.do")//判断是否收藏
    Call<CollectBean>iscollect(@Query("user_id")int user_id,@Query("shop_food_id")int shop_food_id,@Query("flag")int flag);
    @GET( "getAllUserFoodOrder.do")//菜谱评价列表
    Call<List<OrderBean>>getallorder(@Query("food_id")int food_id);
    @GET("insertOrder.do")//购买
    Call<Success>insertOrder(@Query("user_id") int user_id, @Query("food_id") int food, @Query("num") int num, @Query("sum") double sum, @Query("suggesttime") String suggesttime);
    @GET("updateUserById.do")//修改用户信息
    Call<Success> updata(@Query("user_id") int userid, @Query("username") String userName, @Query("userpass") String userPwd, @Query("mobilenum") String phone, @Query("address") String address);
    @GET("getAllUserOrder.do")//订单列表
    Call<List<OrderBean>> getorder(@Query("user_id") int user_id);
    @GET("getFoodBySearch.do")//搜索
    Call<List<FoodBean>> getfoodbysearch(@Query("search") String search);
    @GET("insertComment.do")//增加评论
    Call<Success>insertComment(@Query("order_id") int order_id,@Query("content") String content);
    @GET("updateComment.do")//修改评论
    Call<Success>updateComment(@Query("order_id") int order_id,@Query("content") String content);
    @GET("deleteComment.do")//删除评论
    Call<Success>deleteComment(@Query("order_id") int order_id);
    @GET("getAllUserFoodOrder.do")//菜谱评价列表
    Call<List<OrderBean>> getalluserfoodorder(@Query("food_id") int food_id);
    @GET("getFoodById.do")//菜谱详情
    Call<FoodBean> getfoodbyid(@Query("food_id") int food_id);
}
